import React from 'react'
import { NavBar, Space, Toast,Button } from 'antd-mobile'
import { useNavigate } from 'react-router-dom'
import { ResultPage, Card } from 'antd-mobile'
import { CountDown } from 'react-vant';
import axios from 'axios';

function Index() {
    let nav=useNavigate()
    let id=Date.now()
    let title='飞机票'
    let price=672
    const fu=async()=>{
        let res=await axios.get('/api/pay',{
            params:{
                id,
                title,
                price
            }
        })
        let {code,data}=res.data
        if(code===200){
            window.location.href=data
        }
    }
  return (
    <div>
    <NavBar onBack={()=>nav(-1)}>订单详情</NavBar>
    <div>
    <ResultPage
     
      title='等待支付'
      description='座位席已经锁定请在半完成支付'
    >
        <CountDown time={30 * 60 * 60 * 1000} />;
      <ResultPage.Card style={{ height: 64, padding: 8 }}>
      <div className="nm">
        <p>
          12:45 <br />
          北京大兴
        </p>
        <p >
          5时59分 <br />
         列车停靠站<br />

         1h 12km
        </p>
        <p>
          12:45 <br />
          虹桥
        </p>
     
      </div>
      </ResultPage.Card>

      <Card style={{ marginTop: 12 }}>
        
      <div className='xx'>
            <p>姓名 ：小红</p>
            <p>证件号：1562*********2189 </p>
            <p>二等座 1车07C号坐</p>
            <span>
                ￥672 <br />

                待支付
            </span>
          </div>
      </Card>
      <br /><br />
      <Card title='退票无忧' className='ww'>
        <p>火车票退票(20/2人)</p>
        <h6>z=最高赔付100%手续费</h6>
        <h6>忧享出票服务</h6>
        <p>￥10*2 送五元立减卷+20.5万超值保险套餐</p>

        <h4>温馨提示</h4>
        <p>
            1.阿斯顿撒旦大叔大婶大萨达<br />
            2.啊实打实大师大师大师大苏打手打<br />
            3.啊实打实大撒大声地
        </p>
      </Card>
      <Button block color='primary' size='large' onClick={()=>fu()}>
          支付订单
        </Button>
    </ResultPage>
    
    </div>
    </div>
  )
}

export default Index
